package rmmk.framework;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import rmmk.framework.datasources.Document;

/**
 * klasa przeprowadzjąca analizę dokumentów po klasyfikacji
 * @author marcin
 *
 */
public class Analize {
	private static Logger logger = LoggerFactory.getLogger(Analize.class);
	
	public static void analize(List<Document> documents)
	{
		int numberOfTruePositives = 0;
		int numberOfFalseNegatives = 0;
		
		//String word = documents.get(0).getClassifiedCategories().getPLACES().get(0);
		
		for(Document doc : documents)
		{
			/*if(doc.getClassifiedCategories().getPLACES().get(0) != word)
			{
				logger.info(doc.getClassifiedCategories().getPLACES().get(0));
			}*/
			
			if(doc.getClassifiedCategories().equals(doc))
				numberOfTruePositives++;
			else numberOfFalseNegatives++;
		}
		
		logger.info("true positives: " + numberOfTruePositives + " false negatives: " + numberOfFalseNegatives);
		logger.info("Skuteczność: " + ((double) numberOfTruePositives / (double) documents.size()) * 100 + "%");
	}
}
